<?php

class Item extends AppModel {
	
    var $name = 'Item';
	
	var $actsAs = array ('Searchable');
		
	var $validate = array(
		'name' => array(
			'rule' => array('minLength', 1)
		),
		'description' => array(
			'rule' => array('minLength', 1)
		)
	);
	
	var $hasMany = array(
		'Vote' => array(
			'className' => 'Vote',
			'foreignKey' => 'item_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		),
		'Comment' => array(
			'className' => 'Comment',
			'foreignKey' => 'item_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);
	
	var $hasAndBelongsToMany = array('Category' =>
            array(
                'className'              => 'Category',
                'joinTable'              => 'categories_items',
                'foreignKey'             => 'item_id',
                'associationForeignKey'  => 'category_id',
                'unique'                 => true,
                'conditions'             => '',
                'fields'                 => '',
                'order'                  => '',
                'limit'                  => '',
                'offset'                 => '',
                'finderQuery'            => '',
                'deleteQuery'            => '',
                'insertQuery'            => ''
            )
    );

}

?>